package com.apes.autoparts.parts.model;

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by lishikun on 2020/10/13 17:27
 */

@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = VinLabelModel.CONST_TABLE_NAME)
public class VinLabelModel extends BaseModel {

    public static final String CONST_TABLE_NAME = "vin_label_model";

    @Id
    @Column(name = "id")
    @ApesGenerator(code = CONST_TABLE_NAME, name = "车架号解析临时表")
    @Comment("唯一码")
    private String id;

    @Column(name = "vin", length = 32)
    @Comment("车架号")
    private String vin;

    @Column(name = "PZCXID")
    @Comment("配置车型编码")
    private String PZCXID;

    @Column(name = "QCCPMC")
    @Comment("汽车厂牌名称")
    private String QCCPMC;

    @Comment("解析标记")
    @Column(name = "is_parsing", nullable = false, columnDefinition = "number(1,0) default 0")
    private boolean Parsing = false;

    @Lob
    @Column(name = "massger", columnDefinition = "CLOB")
    @Comment("信息")
    private String massger;

    @Column(name = "timestamp")
    @Comment("时间戳")
    private Date timestamp;
}
